# -*- coding: utf-8 -*-
from .base   import Base, WEATHER_CONDITION
from .region import Region

from datetime import datetime


class Weather(Base("weather", ("measurementDateTime", "regionId", "regionName", "temperature", "humidity", "windSpeed", "precipitationAmount", "weatherForecast", "weatherCondition"))):
    id: int

    measurementDateTime: datetime

    regionId:   int
    regionName: int

    temperature:         float
    humidity:            float
    windSpeed:           float
    precipitationAmount: float

    weatherForecast:  list[int]
    weatherCondition: WEATHER_CONDITION


    @property
    def region(self) -> Region:
        return Region.get_by_id(self.region, self._database)